package com.kfm.am.exec;

import java.util.LinkedList;

public class Exec01 {

    public static void main(String[] args) {
        LinkedList list = new LinkedList();
        for (int i = 0; i < 20; i ++) {
            // 全限定名
            list.add(new com.kfm.am.exec.Student());
        }
        list.sort((o1, o2) -> {
            com.kfm.am.exec.Student s1 = (com.kfm.am.exec.Student) o1;
            com.kfm.am.exec.Student s2 = (com.kfm.am.exec.Student) o2;
            // 97.43 98.32 0.1 1 0  floor 0.5 0
            return s2.getScore() > s1.getScore() ? 1 : (s2.getScore() == s1.getScore() ? 0 : -1);
        });
        list.forEach(obj -> System.out.println(obj));
        System.out.println("first: " + list.getFirst());
        System.out.println("last: " + list.getLast());
    }
}
